package cn.iocoder.yudao.module.biz.controller.admin.company.domain;

import cn.iocoder.yudao.framework.excel.core.util.poi.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 公司信息表
 * @TableName san_biz_company_info
 */
@TableName(value ="san_biz_company_info")
@Data
public class SanBizCompanyInfo implements Serializable {

    @Schema(description = "页码，从 1 开始", requiredMode = Schema.RequiredMode.REQUIRED,example = "1")
    @NotNull(message = "页码不能为空")
    @Min(value = 1, message = "页码最小值为 1")
    @TableField(exist = false)
    private Integer pageNo = 1;

    @Schema(description = "每页条数，最大值为 100", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
    @NotNull(message = "每页条数不能为空")
    @Min(value = 1, message = "每页条数最小值为 1")
    @Max(value = 100, message = "每页条数最大值为 100")
    @TableField(exist = false)
    private Integer pageSize = 10;

    @TableField(exist = false)
    private Integer offset;

    public Integer getOffset() {
        return (new BigDecimal(this.pageNo).subtract(BigDecimal.ONE))
                .multiply(new BigDecimal(this.pageSize)).intValue();
    }

    /**
     * 唯一标识符
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 公司名称
     */
    @Excel(name = "公司名称")
    @Schema(description = "公司名称")
    private String companyName;

    /**
     * 税号
     */
    @Excel(name = "税号")
    @Schema(description = "税号")
    private String taxNumber;

    /**
     * 单位地址
     */
    @Excel(name = "单位地址")
    @Schema(description = "单位地址")
    private String address;

    /**
     * 电话
     */
    @Excel(name = "电话")
    @Schema(description = "电话")
    private String phone;

    /**
     * 开户银行
     */
    @Excel(name = "开户银行")
    @Schema(description = "开户银行")
    private String bankName;

    /**
     * 银行账户
     */
    @Excel(name = "银行账户")
    @Schema(description = "银行账户")
    private String bankAccount;

    /**
     * 邮箱
     */
    @Excel(name = "邮箱")
    @Schema(description = "邮箱")
    private String invoiceEmail;

    /**
     * 创建人
     */
    @Excel(name = "创建人")
    @Schema(description = "创建人")
    private String creator;

    /**
     * 创建时间
     */
    @Excel(name = "创建时间",align = HorizontalAlignment.LEFT, width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    private Date createTime;

    /**
     * 修改人
     */
    private String updater;

    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 租户编号
     */
    private Long tenantId;

    /**
     * 删除标识
     */
    private Boolean deleted;

    @Schema(description = "客户id")
    private Long customerId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Schema(description = "1客户信息，2公司信息")
    private String type;
}